Don't use QDateTime to parse XML times just yet.
authorrobertlipe <robertlipe@gmail.com>
Mon, 28 Jan 2013 01:13:04 +0000 (01:13 +0000)
committerrobertlipe <robertlipe@gmail.com>
Mon, 28 Jan 2013 01:13:04 +0000 (01:13 +0000)
gpsbabel/gpx.cc

index 10b83a78ef966b5dcc2799203f6b9a7a0c310d46..735d8bf08b8d16d1ae8a39259c325d7cc8b5d73d 100644 (file)
@@ -855,27 +855,6 @@ gs_get_container(geocache_container t)
 time_t
 xml_parse_time(const char* cdatastr, int* microsecs)
 {
-#if NEWTIME
-  time_t rv = 0;
-  QString string_date(cdatastr);
-
-  // Lovely.  It looks like the OSM format triggers Qt Bug 18290. by
-  // leaving it ambiguous whether DST is in effect, which triggers local 
-  // time. Allegedly fixed in Qt 5.0, but trivial to work around.
-  // https://bugreports.qt-project.org/browse/QTBUG-18290
-  if (string_date.endsWith("+00:00")) {
-    string_date.replace("+00:00", "Z");
-  }
-  QDateTime dt(QDateTime::fromString(string_date, Qt::ISODate));
-
-  if (dt.isValid()) {
-    rv =  dt.toTime_t();
-    if (microsecs) {
-      *microsecs = dt.time().msec() * 1000;
-    }
-  }
-  return rv;
-#else
   int off_hr = 0;
   int off_min = 0;
   int off_sign = 1;
@@ -939,7 +918,6 @@ xml_parse_time(const char* cdatastr, int* microsecs)
   xfree(timestr);
 
   return rv;
-#endif
 }
 
 static void